# Contributor: Kaarle Ritvanen <kunkku@alpinelinux.org>
# Maintainer: Kaarle Ritvanen <kunkku@alpinelinux.org>
pkgname=py3-phonenumbers
pkgver=8.13.27
pkgrel=0
pkgdesc="International phone number library for Python"
url="https://github.com/daviddrysdale/python-phonenumbers"
arch="noarch"
license="Apache-2.0"
depends="python3"
makedepends="
	py3-gpep517
	py3-setuptools
	py3-wheel
	"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/p/phonenumbers/phonenumbers-$pkgver.tar.gz"
builddir="$srcdir/phonenumbers-$pkgver"

replaces="py-phonenumbers" # Backwards compatibility
provides="py-phonenumbers=$pkgver-r$pkgrel" # Backwards compatibility

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 testwrapper.py
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
4c438b21baa83a211fefc22806e605be7c5fb10aa4e6a432d587c1314f5eeab339e995d3aaf29626d014a2ca257a179f3913e8110f5a1bdc74efbf019e7484fd  phonenumbers-8.13.27.tar.gz
"
